package com.dongdong.controller;

import com.dongdong.em.Result;
import com.dongdong.service.EsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("es")
public class ESController {

    @Autowired
    private EsService esService;

    @GetMapping("search")
    public String es(String index, String str) {
        System.out.println("es");
        String es = esService.es(index, str);
        return es;//这里不能用result   注意啦!!!!    不使用result   记得前端也不要获取code的状态了
    }
}
